Fixed the registration of commands with invalid JSON file

When the JSON file in the current folder is invalid, the registration of custom commands should be ignored rather than breaking the usage of Composer entirely.
Closes #3165
AFAICT the `, true` should be one level out applied to json_decode, not file_get_contents