Make bn.d more const correct.

Functions in bn.d which are generated from C macros are not const-correct - this commit fixes the problem.