android: Avoid IllegalStateException when importing certificates