minor perf improvement (~4%) for bitboard move generator

- add if else in updateCastleFlag to update the flag only for the needed
side (with the template optimization if/else on chance are effectively
free)
- add a compile time switch for the template chance optimization