Fixed most const warnings and added pragmas to ignore false warnings

Im using the OpenSC project to do some tests with smartcards and got annoyed by continuous warnings about const casts:

The OpenSC project master creates quite some warning concerning due to cons u8 * conversions to u8 *. These are correct but should be properly cast. There are some unused variables which also cause warnings. I simply got tired of them and wanted to avoid most (if not all) warnings as possible. Some are invalid and I added pragma statements to ignore the warnings. 
A much better patch is to change the type of buf from ``const u8 *`` to ``u8 *``.

In this case the cast is no more needed and the code is much cleaner.