After my unsuccessful attempts at contributing RetroArch I've decided to publish these patches in my retroarch fork, hopefully they will be useful by people affected by my same problems.
Fix: wait for all input to be released before starting the core, commit patch here
Issue: rather difficult to troubleshoot input issues might be related to wrong joystick configuration, that is also difficult to detect without a jstest-like program
Fix: enable logging of input events directly in retroarch, commit patch here
commit patch here