optimized the bitmap implementation

1. change the bits of bitmap to allow the last bit to be set/unset
2. add the implementation for bitmap destroy