move mutex to port layer at crypto level
add proper locking to fp ecc
free fp ecc resources on cleanup
fix shadow warning