STM32F103 - Simple blinky, but voltage on TMS & TDI
I avoid using the JTAG and SWD pins as I/O pins because they need to actively programmed to be I/O pins.

I can't see the code doing that so it is likely that those pins are not operating as GPIO.

Get a copy of 'RM0008 Reference manual' manual from ST.

In section '9.3.5 JTAG/SWD alternate function remapping' it explains how to map the SWD and JTAG pins to become ordinary GPIO pins. Table '37. Debug port mapping' explains which values to set in SWJ _CFG bits in the AFIO+MAPR register to map those JTAG/SWD pins to GPIO.

For example if the SWJ_CFG bits are set to 100, all of the JTAG and SWD pins are available for GPIO.

I would encourage you to avoid this. At least don't map the SWD pins, so that it is easier to debug your board. 

Also some of the SWD pins might be accessed from an external debugger (depending on the software driving it) while it is connected, and this might also be a cause of enough activity to light LEDs dimly.