Metrics Service Command Retry

Added logic to retry the Package statistics insert sql command. Also, added more tracing
Moved this check from PackageStatsHandler.cs