Fix #48 for unexpected program running

This patch provide two fix:
1. For the resetStopOnReset function, there's a redundant reset which will lead to the issue that during this function the user program will still run for a while.
2. During the load process, setTargetState need to set C_HALT bit and use resetStopOnReset instead of reset to avoid unexpected running of previous program.
Here we add C_HALT bit to still halt the mcu after enabling debugging, otherwise it will start to run for a short while.