Fixes in demula theme

1.  The function that outputs the exit code of the last failed command uses the exit code of any command executed 
     before. That means that currently it is using the exit code of the last command executed inside the prompt 
     function (in my case I noticed it when the battery_charge function failed).

     By calling the mitsuhikos_lastcommandfailed function in the first line of the prompt function, we make sure the exit 
     code corresponds to the last executed command, and not the commands executed before inside the function.

2.  battery_charge failed because I hadn't installed the battery plugin and so the function wasn't available. Now I 
     check that the plugin is installed before calling the function.