Problem with BLDC motor drive using PWM
When there is a delay shutting off the current from one switch after the other complementary switch was turned on then there is a "shoot-thru" condition where there is a momentary short circuit current surge across the power supply thru the pair of switches.  This commutation of "make-before-break" is fixed by timing control of each switch gate drive to allow both to be off for some x microseconds period, usually dependent on the T=L/R ratio.  This is also called dead-time control.

Normally the diode//R attempts to turn OFF the gate faster than turn ON to assist in increasing deadtime but depending on Vgs slew rate, gate capacitance, source impedance, load inductance, ESR, RdsOn and L/R ratio, there are many contributors to delayed turn off.  A simple way is to increase the value of the parallel Gate R but this has its limits with PWM frequency and gate capacitance.

More basics.

http://www.modularcircuits.com/blog/articles/h-bridge-secrets/h-bridges-the-basics/