Update bouncycastle dependency to 1.51

Current bouncycastle version used in gradle is quite old (2011). I think it's important to keep up with upstream.