fix issue #202 and introduce more type safety

This fixes issue #202 where I added stuff to the invector before
updating the size.

Additionally, this commit also adds additional type safety features to
the int-vector-mapper. The mapper now has an additional template
parameter:

`
template <t_width,t_mode> class int_vector_mapper
`

where the ``open mode'' can be specified. For example,

`
const int_vector_mapper<0,std::ios_base::in> ivm(tmp_file);
`

maps a file in read only mode. thus, only operations which do not modify
the underlying file are permitted. Using other operations causes a
compilation error.

The default mode remains read+write so existing code is not affected:

`
int_vector_mapper<0,std::ios_base::out|std::ios_base::in> ivm(tmp_file);
`

is equal to

`
int_vector_mapper<> ivm(tmp_file);
`

the examples and tests are adjusted accordingly.
Merge pull request #204 from mpetri/int-vec-mapper-fixes

fix issue #202 and introduce more type safety